package cn.yangliu.service.impl;

import cn.yangliu.entity.OftenUseCommand;
import cn.yangliu.jpa.base.service.impl.JpaServiceImpl;
import cn.yangliu.repository.OftenUseCommandRepository;
import cn.yangliu.service.OftenUseCommandService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * the type of serial-port-tool
 *
 * <p>
 * .
 *
 * @author 杨柳
 * @date 2021-10-13
 */
@Service
@Transactional(rollbackFor = Throwable.class)
public class OftenUseCommandServiceImpl extends JpaServiceImpl<OftenUseCommand, Long, OftenUseCommandRepository> implements OftenUseCommandService {

    /**
     * 根据settingId查询常用指令
     *
     * @param settingId settingId
     * @return 常用指令集合
     */
    @Override
    public List<OftenUseCommand> findBySettingId(Long settingId) {
        return repository.findBySettingId(settingId);
    }

    /**
     * 根据settingId删除
     *
     * @param settingId settingId
     */
    @Override
    public void deleteBySettingId(Long settingId) {
        repository.deleteBySettingId(settingId);
    }
}
